//
//  WmcTeamMemberHeaderView.swift
//  YPWatermarkCamera
//
//  Created by yupao_ios_macmini06 on 2022/9/14.
//

import UIKit

class WmcTeamMemberHeaderView: WmcBaseView {
    var model: (img: String, title: String)? {
        didSet {
            guard let model = model else {
                return
            }
            self.iconView.image = UIImage(named: model.img)
            self.titleLabel.text = model.title
        }
    }

    override func makeUI() {
        addSubview(iconView)
        addSubview(titleLabel)
        addSubview(arrowImageView)
        addSubview(lineView)

        iconView.snp.makeConstraints { make in
            make.top.equalTo(18)
            make.left.equalTo(19)
            make.bottom.equalTo(-18)
            make.width.height.equalTo(22)
        }
        titleLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(iconView.snp.right).offset(12)
        }
        arrowImageView.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.right.equalTo(-16)
            make.width.height.equalTo(18)
        }
        lineView.snp.makeConstraints { make in
            make.left.right.bottom.equalToSuperview()
            make.height.equalTo(1)
        }
    }

    lazy var iconView: UIImageView = {
        let view = UIImageView()
        view.image = UIImage(named: "add_team_member")
        return view
    }()

    lazy var titleLabel: UILabel = {
        let view = UILabel()
        view.textColor = UIColor.wmc_grayH2_323233
        view.font = 17.yp.uiFont
        view.text = "邀请成员加入"
        return view
    }()

    /// 箭头
    lazy var arrowImageView: UIImageView = {
        let imageView = UIImageView(image: "teamAlbumRightArrow".wmc_image)
        imageView.contentMode = .scaleAspectFit
        return imageView
    }()

    lazy var lineView: UIView = {
        let view = UIView()
        view.backgroundColor = UIColor.wmc_grayH19_F5F5F5
        return view
    }()
}
